<?php
class Administration_Form_Locations extends Jnd_Form
{

    public function __construct( $decorateur = "Formulairejnd", $options = null )
    {
        parent::__construct($decorateur, $options);
        $this->setElementDecorators(array(
            "$decorateur"
        ), array(
            'logo'
        ), false);
    }

    public function init()
    {
        
        //
        // On ajoute le champ id
        $this->addElement('text', 'id', array(
            'label' => 'Id', 
            'readonly' => 'readonly', 
            'class' => 'readonly', 
            'filters' => array(
                'Digits'
            )
        ));
        
        //
        //  Champ Nom
        $this->addElement("text", "name", array(
            'label' => 'Nom', 
            'required' => true, 
            'filters' => array()
        ));
        
        //
        //  field Address1
        $field = new Zend_Form_Element_Textarea("address1");
        $field->setLabel(__('Address 1'));
        $field->setAttribs(array(
            'rows' => 4, 
            'cols' => 50, 
            'onfocus' => 'this.select();'
        ));
        $fields[] = $field;
        
        //
        //  field Address2
        $field = new Zend_Form_Element_Textarea("address2");
        $field->setLabel(__('Address 2'));
        $field->setAttribs(array(
            'rows' => 3, 
            'cols' => 50, 
            'onfocus' => 'this.select();'
        ));
        $fields[] = $field;
        
        //
        //	field ZipCode
        $field = new Zend_Form_Element_Text("zipcode");
        $field->setLabel(__("Zip code"));
        $fields[] = $field;
        
        //
        //	field City
        $field = new Zend_Form_Element_Text("city");
        $field->setLabel(__("City"));
        $fields[] = $field;
        
        //
        //	field Country
        $field = new Zend_Form_Element_Text("country");
        $field->setLabel(__("Country"));
        $fields[] = $field;
        
        $this->addElements($fields);
        
        //
        //  Champ creationUser
        $this->addElement("text", "creationUser", array(
            'label' => __('Created by'), 
            'readonly' => 'readonly', 
            'class' => 'readonly', 
            'filters' => array()
        ));
        
        //
        //  Champ creationDate
        $this->addElement("text", "creationDate", array(
            'label' => __('Created'), 
            'readonly' => 'readonly', 
            'class' => 'readonly', 
            'filters' => array()
        ));
        
        $this->setName("locations");
    }

}